package com.atguigu.gmall.feign.search;


import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.search.entity.Goods;
import com.atguigu.gmall.search.vo.SearchParamVo;
import com.atguigu.gmall.search.vo.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/api/inner/search")
@FeignClient("service-search")
public interface SearchFeignClient {
    @PostMapping("/onsale")
    Result onSaleGoods(@RequestBody Goods goods);

    @DeleteMapping("/cancelSale/{skuId}")
    Result cancelSale(@PathVariable("skuId") Long skuId);
        // 检索商品
    @PostMapping("/sku/search")
    Result<SearchResponseVo> search(@RequestBody SearchParamVo paramVo);

    @GetMapping("/hotscore/{skuId}")
    public Result updateHotScore(@PathVariable("skuId") Long skuId,
                                 @RequestParam("hotScore") Long hotScore);
}
